import { request } from './request'
import store from '../store/index'
export function getchannel () {
  return request({
    method: 'get',
    url: '/v1_0/user/channels'
  })
}

export function refreshTokenAPI () {
  return request({
    url: '/v1_0/authorizations',
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${store.state.refresh_token}`
    }
  })
}

export function loginIn (data) {
  return request({
    method: 'post',
    url: '/v1_0/authorizations',
    data: {
      mobile: data.mobile,
      code: data.code
    }
  })
}

export function getAllChannels () {
  return request({
    method: 'get',
    url: '/v1_0/channels'
  })
}
